
<%@page import="java.util.List"%>
<%@page import="fu.abc.model.Account"%>
<%@page import="fu.abc.DAO.ManageDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Vnplace - System admin</title>

<!-- CSS -->
<link href="css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="style/js/jquery.js"></script>
<script type="text/javascript" src="style/js/jNice.js"></script>
<style>
	#header{
		height: 60px;
		width: max;
		background: #19A3A3;
		color: white;
	}
	a.logout{
		list-style: none;
		font-size: 15px;
		float: right;
		padding-top: 22px;
		text-decoration: none;
		color: white;
		margin-right: 20px;
	}
	a.logout:hover{
		color: 	#E6E6B8;
		text-decoration: underline;
		font-size: 16px;
	}
	
	p.hello{
		float: right;
		font-size: 15px;
		margin-right: 30px;
		padding-top: 22px;
	}
	
</style>
</head>

<body>
	<div id="wrapper">
    	<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
    	<div id="header">
    		<%String acc = (String)session.getAttribute("acc"); %>
			<b><a href="logout.jsp" class="logout">Đăng xuất</a></b>
			<%
				if(acc==null){
					response.sendRedirect("/Vnplace/systemAdmin/login.jsp");
				}else{
					
// 					response.sendRedirect("/Vnplace/systemAdmin/createAccount.jsp");
			%>
    		<p class="hello">Chào, <b><%=acc %></b></p>    	
    		<%} %>	
    	</div>
        
        <!-- // #end mainNav -->
        
        <div id="containerHolder">
        <h1>Hệ thống quản lý</h1>
			<div id="container">
        		<div id="sidebar">
                	<ul class="sideNav">
                		<li><a href="Login.html">Trang chủ</a></li>
                    	<li><a href="manageAccount.jsp">Quản lý tài khoản</a></li>
                    	<li><a href="createAccount.jsp">Tạo tài khoản mới</a></li>
						
                    </ul>
                    <!-- // .sideNav -->
                </div>    
                <!-- // #sidebar -->
                
                <!-- h2 stays for breadcrumbs -->
                
                <div id="main">
                	<form action="" class="jNice">
						<table>
							<tr>
								<td>
									<fieldset id="fieldset">
										<legend>Quản lý tài khoản</legend>
										<table>
									
											<tr>
												<td align="center"><b>Tên</b></td>
												<td align="center"><b>Chức vụ</b></td>
												<td align="center"><b>Tài khoản</b></td>
												<td style="width: 60px;"></td>
												<td style="width: 30px;"></td>
												<td style="width: 30px;"></td>
											</tr>
										
										<%
											ManageDAO manage = new ManageDAO();
											List<Account> list = manage.listAccount();
											for(Account a: list){
										%>
											<tr>
												<td><%=a.getUsername() %></td>
												<td><%=a.getRole() %></td>
												<td><%=a.getAccount() %></td>
												<td><a href="editAccount.jsp?idAcc=<%=a.getIdAcc() %>">Chỉnh sửa</a></td>
												<td><a href="/Vnplace/DeleteAccount?idAcc=<%=a.getIdAcc() %>">Xóa</a></td>
												<td><a href="viewAccount.jsp?idAcc=<%=a.getIdAcc() %>">Xem</a></td>
											</tr>
										<% } %>
								
										</table>
									</fieldset>
								</td>
							</tr>
						</table>
                    </form>
                </div>
                <!-- // #main -->
                
                <div class="clear"></div>
            </div>
            <!-- // #container -->
        </div>	
        <!-- // #containerHolder -->
        <div id="footer" class="footer">
			<p class="copyright">©Copyright 2014 VnPlace.vn</p>
		</div>
    </div>
    <!-- // #wrapper -->
</body>
</html>
